package com.huilian.iotbox.client.controller;

import com.huilian.iotbox.client.security.jwt.util.JwtTokenUtil;
import com.huilian.iotbox.client.service.CustomerServiceInfoService;
import com.huilian.iotbox.data.common.ServerResponse;
import com.huilian.iotbox.data.controller.BaseController;
import com.huilian.iotbox.data.dto.CustomerServiceInfoDto;
import com.huilian.iotbox.data.dto.MemberDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 龙 路 飞
 * @CreateDate: 2021-11-09 16:13
 * @Description:
 */
@RestController
@RequestMapping("/api/customerServiceInfo")
public class CustomerServiceInfoController extends BaseController {

    @Autowired
    private JwtTokenUtil jwtTokenUtil;
    @Autowired
    private CustomerServiceInfoService customerServiceInfoService;


    @GetMapping("/findCustomerServiceInfoByApplet")
    public ServerResponse findCustomerServiceInfoByApplet(HttpServletRequest request, CustomerServiceInfoDto customerServiceInfoDto) throws Exception {
        final MemberDto memberFromReq = jwtTokenUtil.getMemberFromReq(request);
        return customerServiceInfoService.findCustomerServiceInfoByApplet(customerServiceInfoDto, memberFromReq);
    }

}
